package cn.sirun.com.fca.map.repo;

import com.tencent.cloud.iov.kernel.constant.HttpHeaderConst;
import com.tencent.cloud.iov.kernel.model.BaseResponse;

import cn.sirun.com.fca.map.model.repose.MapCarLocation;
import cn.sirun.com.fca.map.model.repose.MapCollectedResponse;
import cn.sirun.com.fca.map.model.repose.MapHomeCompanyResponse;
import cn.sirun.com.fca.map.model.request.MapAddCollectedRequest;
import cn.sirun.com.fca.map.model.request.MapCollectedRequest;
import cn.sirun.com.fca.map.model.request.MapDeleteCollected;
import cn.sirun.com.fca.map.model.request.MapSendCarRequest;
import io.reactivex.Observable;
import okhttp3.RequestBody;
import retrofit2.http.Body;
import retrofit2.http.GET;
import retrofit2.http.Header;
import retrofit2.http.Headers;
import retrofit2.http.POST;
import retrofit2.http.Path;
import retrofit2.http.Query;

public interface MapService {
//    /v1/tsp/sd2v/favorite_address/list
    //查看收藏夹
    @Headers({HttpHeaderConst.ADD_COOKIE, HttpHeaderConst.CONTENT_TYPE_JSON})
    @POST("/v1/tsp/sd2v/favorite_address/list")
    Observable<BaseResponse<MapCollectedResponse>> mapcollected(@Header("din") String din,
                                                                @Query("startPage") String startPage,
                                                                @Query("pageSize") String pageSize, @Body MapCollectedRequest request );

    //添加收藏夹
    @Headers({HttpHeaderConst.ADD_COOKIE, HttpHeaderConst.CONTENT_TYPE_JSON})
    @POST("/v1/tsp/sd2v/favorite_address/add")
    Observable<BaseResponse<MapCollectedResponse>> mapaddcollect(@Header("din") String din,
                                                                 @Body MapAddCollectedRequest request );

    //删除收藏夹
    @Headers({HttpHeaderConst.ADD_COOKIE, HttpHeaderConst.CONTENT_TYPE_JSON})
    @POST("/v1/tsp/sd2v/favorite_address/delete")
    Observable<BaseResponse<Void>> mapDeleteAddress(@Header("din") String din,
                                                                 @Body MapDeleteCollected request );

    //查看家和公司地址
    @Headers({HttpHeaderConst.ADD_COOKIE, HttpHeaderConst.CONTENT_TYPE_JSON})
    @POST("/v1/tsp/sd2v/commonly_address")
    Observable<BaseResponse<MapHomeCompanyResponse>> mapHomeCompany(@Header("din") String din,@Body MapCollectedRequest request);

    //发送到车
    @Headers({HttpHeaderConst.ADD_COOKIE, HttpHeaderConst.CONTENT_TYPE_JSON})
    @POST("/v1/tsp/sd2v/location")
    Observable<BaseResponse<BaseResponse>> mapSendToCar(@Header("din") String din,@Body MapSendCarRequest request);

    //获取最近一次上传位置, @Body MapCollectedRequest request
    @Headers({HttpHeaderConst.ADD_COOKIE, HttpHeaderConst.CONTENT_TYPE_JSON})
    @GET("/v1/tsp/vf/location")
    Observable<BaseResponse<MapCarLocation>> getLastLocation(@Header("din") String din);

    //更新车位置
    @Headers({HttpHeaderConst.ADD_COOKIE, HttpHeaderConst.CONTENT_TYPE_JSON})
    @POST("/v1/tsp/vf/update")
    Observable<BaseResponse<MapCarLocation>> updateLocation(@Header("din") String din,
                                                            @Body MapCollectedRequest request );
}
